import 'dart:convert';
import 'package:shared_preferences/shared_preferences.dart';

class Storage {
  static void setString(key,value) async{
    if(value != null && value != 'null'){
      SharedPreferences prefs = await SharedPreferences.getInstance();
      await prefs.setString(key, jsonEncode(value));
    }
  }

  static getString(key) async{
    SharedPreferences prefs = await SharedPreferences.getInstance();
    var res = await prefs.getString(key);
    return res;
  }
}